package com.neusoft.hifly.rpc.area.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * Title: 数据字典服务
 * <p>
 * Description: 省份信息对象
 * <p>
 * Copyright: 2019
 * <p>
 * Company: 东软汉枫
 *
 * @author lihui
 * @version 1.0.0
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@TableName(value = "SYS_AREA_PROV")
public class ProvObj implements Serializable {
	private static final long serialVersionUID = -158315713243458L;
	// 主键
	@ApiModelProperty(value = "主键")
	private long id;
	// 逻辑ID
	@ApiModelProperty(value = "逻辑ID")
	private long logicId;
	// 省份
	@ApiModelProperty(value = "省份")
	private String name;
	// 排序(升序)
	@ApiModelProperty(value = "排序(升序)")
	private int myOrder;
	// 修改人
	@ApiModelProperty(value = "修改人")
	private String updatePerson;
	// 修改时间
	@ApiModelProperty(value = "修改时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonDeserialize(using = LocalDateTimeDeserializer.class)
	@JsonSerialize(using = LocalDateTimeSerializer.class)
	private LocalDateTime updateTime;

	/**
	 * 得到对象的哈希值
	 *
	 * @return int 对象的哈希值
	 */
	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(this.getLogicId()).toHashCode();
	}

	/**
	 * 比较两个对象是否相等
	 *
	 * @param other
	 *            要比较的对象
	 * @return boolean 相同返回true，否则返回flase
	 */
	@Override
	public boolean equals(final Object other) {
		if (!(other instanceof ProvObj)) {
			return false;
		}
		final ProvObj castOther = (ProvObj) other;
		return new EqualsBuilder().append(this.getLogicId(), castOther.getLogicId()).isEquals();
	}

	/**
	 * 返回对象的字符串值
	 *
	 * @return String 表示用户对象的字符串值
	 */
	@Override
	public String toString() {
		return new ToStringBuilder(this).append("省份信息", this.getName()).toString();
	}

	public long getId() {
		return id;
	}

	public void setId(final long id) {
		this.id = id;
	}

	public long getLogicId() {
		return logicId;
	}

	public void setLogicId(final long logicId) {
		this.logicId = logicId;
	}

	public String getName() {
		return name;
	}

	public void setName(final String name) {
		this.name = name;
	}

	public int getMyOrder() {
		return myOrder;
	}

	public void setMyOrder(final int myOrder) {
		this.myOrder = myOrder;
	}

	public String getUpdatePerson() {
		return updatePerson;
	}

	public void setUpdatePerson(final String updatePerson) {
		this.updatePerson = updatePerson;
	}

	public LocalDateTime getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(final LocalDateTime updateTime) {
		this.updateTime = updateTime;
	}

}
